/* Layout */
import Layout from '../views/layout/Layout'

const _import = require('./_import_' + process.env.NODE_ENV)

const permissionRoutes = [
  {
    path: '/permission',
    component: Layout,
    redirect: 'noredirect',
    name: 'permission',
    meta: {
      title: '权限管理',
      icon: 'lock',
      roles: []
    },
    children: [
      // {
      //   path: 'function',
      //   name: 'function-setting',
      //   component: _import('permission/functionSetting'),
      //   meta: {
      //     title: '功能权限管理',
      //     icon: 'people',
      //     roles: []
      //   }
      // },
      {
        path: 'permission-post',
        name: 'permission-post',
        component: _import('permission/workSetting'),
        meta: {
          title: '岗位权限管理',
          roles: ['create','switch','edit','check','role-set','copy','data-role-set']
        }
      },
      {
        path: 'permission-user',
        name: 'permission-user',
        component: _import('permission/accountSetting'),
        props: (route) => (
          {
            departmentId: Number(route.query.departmentId),
            jobId: Number(route.query.jobId),
          }
        ),
        meta: {
          title: '账户岗位管理',
          roles: ['switch','edit']
        }
      },
      {
        path: 'permission-user-add',
        name: 'permission-user-add',
        component: _import('permission/createAccount'),
        meta: {
          title: '新建账号',
          roles: []
        }
      }
    ]
  }
]

export default permissionRoutes
